import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:ls_work/net/response/visitor_check/visitor_check_list_data.dart';

class VisitorCheckListViewModel extends BaseListViewModel<VisitorCheckListData>{
  VisitorCheckListViewModel(BuildContext context) : super(context);

  var json = [
    {"date":"2022-01-02","name":"张三","old":"张爷爷","status":"已审核"},
    {"date":"2022-01-02","name":"李斯","old":"李爷爷","status":"待审核"},
    {"date":"2022-01-02","name":"王武","old":"王奶奶","status":"已过期"},
  ];

  @override
  Future<List<VisitorCheckListData>> requestListData() {
    var list = json.map((e) => VisitorCheckListData.fromJson(e)).toList();
    return Future.value(list);
  }

  @override
  void onCreated() {
    super.onCreated();
    requestRefresh();
  }

}